﻿@using Microsoft.AspNetCore.Components.Forms

<MFileInput TValue="IBrowserFile"
            Rules="_rules"
            Accept="image/png, image/jpeg, image/bmp"
            Placeholder="Pick an avatar"
            PrependIcon="mdi-camera"
            Label="Avatar"></MFileInput>

@code {
    private List<Func<IBrowserFile, StringBoolean>> _rules = new List<Func<IBrowserFile, StringBoolean>>()
        {
            value=>(value==null||value.Size<2000000)?true:"Avatar size should be less than 2 MB!"
        };
}